<div class="row">
  <div class="span3 bs-docs-sidebar ">
 	<*include file="<*$controller*>/location.tpl"*>
  </div>
<script language="javascript" type="text/javascript" src="/js/DatePicker/WdatePicker.js"></script>
<style type="text/css">
.Wdate{border:0px; }
</style>
  <div class="span9"> 
   <div class="clearfix txtleft search span9" style="background-color:#f8f8f8; padding:10px; margin:10px 0px;"> 
      <form action="/<*$controller*>/index" method="get"   name="form1" class="form-horizontal">       
		    <select id="jigou" name="groups"  ></select>&nbsp;&nbsp;
            开始日期：<input type="text" class="Wdate" id="start_date" onclick="WdatePicker()" style="width:110px"  name="start_date" class="Wdate" value="<*$start_date*>" autocomplete="off"/> 
            ~  结束日期：<input type="text" class="Wdate" id="end_date" onclick="WdatePicker()" style="width:110px"  name="end_date" class="Wdate" value="<*$end_date*>" autocomplete="off"/>&nbsp;&nbsp;  
            <button type="submit" class="btn btn-success" >查询</button>&nbsp;&nbsp;
            <button type="button" class="btn btn-success"  onclick="window.location='/<*$controller*>/index'" >清空查询</button>
      </form>
	</div>	
        <div class="span7" style="text-align:center; margin-top:20px;"> 
    	<*if $school*>
            <table class="table table-bordered table-hover" style="cursor:pointer;" >
                <tr><th>学校名称</th><th>学生数</th><th>已发照片数</th><th>已发视频数</th></tr>
                <*foreach from=$school item=item key=key*>
                <tr onclick="chooseit(<*$key*>,<*$groups*>,'<*$start_date*>','<*$end_date*>')">
                <td><*$item.schoolname*></td>
                <td><*if $item.student*><*$item.student*><*else*>0<*/if*></td>
                <td><*if $item.picture*><*$item.picture*><*else*>0<*/if*></td>
                <td><*if $item.video*><*$item.video*><*else*>0<*/if*></td>
                </tr>
                <*/foreach*>
            </table>
        <*else*>
            请选择机构及起止日期！
        <*/if*>    
        </div>
  </div>
</div>
</div>


<script type="text/javascript"> 
       function   ajax_post(){ 
	    var groupsid="<*$groups*>"; 
        $.post("/<*$controller*>/groups/",{"jigouid":groupsid},function(data,statusText){ 
			 $("#jigou").append(data); 
        });  
	 } 
	  
	  $("#jigou").change(function(){
           // $("#city option:gt(0)").remove();  //清空所有城市的信息
            //$("#county option:gt(0)").remove();  //清空所有县级的信息
            var id = this.value;
			var schoolid="<*$schoolid*>";  
			  
            $.post("/<*$controller*>/schoollist/",{"id":id,"sid":schoolid},function(data,statusText){
                 $("#school").html('');
                 $("#school").append(data);
            
            });
        });
		
		$("#school").change(function(){
           // $("#city option:gt(0)").remove();  //清空所有城市的信息
            //$("#county option:gt(0)").remove();  //清空所有县级的信息
            var sid = this.value; 
            $.post("/<*$controller*>/classlist/",{"id":sid},function(data,statusText){
				 
                 $("#class1").html('');
                 $("#class1").append(data);
            
            });
        });
		
	
	 window.onload=function(){
	    ajax_post(); 
	 if( '<*$groups*>'+0 != 0 ){ 
	        
			var id = '<*$groups*>'; 
			var sid = '<*$schoolid*>';  
			 
			$.post("/<*$controller*>/schoollist/",{"id":id,"sid":sid},function(data,statusText){
				 $("#school").html('');
				 $("#school").append(data); 
				});
	    } 
          
	 if('<*$schoolid*>'+0 != 0){   
		   var id = '<*$schoolid*>'; 
		   var cid='<*$classid*>';
			$.post("/<*$controller*>/classlist/",{"id":id,"cid":cid},function(data,statusText){ 
				 $("#class1").html('');
				 $("#class1").append(data); 
				}); 
		   
	 }/* */

 } 
	
function chooseit(schoolid,groupid,start,end)
{
   window.location='/<*$controller*>/statisclass/schoolid/'+schoolid+'/groupid/'+groupid+'/start_date/'+start+'/end_date/'+end;
}
	  
</script> 
